Skip to content

refactor: streamline status code conversion#8

Merged
RAprogramm merged 1 commit intomainfrom
codex/refactor-status-handling-in-response.rs
Sep 11, 2025
Merged

refactor: streamline status code conversion#8
RAprogramm merged 1 commit intomainfrom
codex/refactor-status-handling-in-response.rs

Conversation

@RAprogramm
Copy link
Owner

Summary

  • use status_code() directly in Axum integration
  • pass status_code() to Actix HttpResponse::build

Testing

  • cargo +nightly fmt --
  • cargo clippy -- -D warnings
  • cargo build --all-targets
  • cargo test --all
  • cargo doc --no-deps

https://chatgpt.com/codex/tasks/task_e_68c26f2fc388832b8181672a59dd33f1

@RAprogramm RAprogramm merged commit 1825288 into main Sep 11, 2025
1 of 2 checks passed
@RAprogramm RAprogramm deleted the codex/refactor-status-handling-in-response.rs branch September 11, 2025 06:44
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines 325 to 327
fn respond_to(self, _req: &HttpRequest) -> HttpResponse {
let status = self.status_code();
let status = ActixStatus::from_u16(status.as_u16())
.unwrap_or(ActixStatus::INTERNAL_SERVER_ERROR);

let mut builder = HttpResponse::build(status);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Restore Actix status code conversion

The refactor now passes self.status_code() directly into HttpResponse::build, but status_code() produces a http v1::StatusCode while Actix 4 still re‑exports http v0.2::StatusCode. Previously the code converted through ActixStatus::from_u16(...) to bridge the two versions. With that conversion removed, enabling the actix feature causes this module to fail to compile because the types are different. Re‑introducing the conversion or aligning the http dependency is required for builds with the Actix feature enabled.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant